package org.no_ip.martin_springwald.google.api.extension.docs;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * DocumentsListChangesEntry (DocsService)
 * 
 * @.dependencies gwt-gdata, GWT SDK 2.4
 */
public class DocumentsListChangesEntry extends com.google.gwt.gdata.client.Entry<DocumentsListChangesEntry> {

	// retrieve links and categories, extended from default functions
	/** getDocumentEntryLinks: <p>Retrieves all links contained in entry.</p> */
	public final native DocumentsListEntryLink[] getDocumentEntryLinks() /*-{ if (this.link) { return @com.google.gwt.gdata.client.impl.ArrayHelper::toArray(Lcom/google/gwt/core/client/JsArray;)(this.link); } else { return new Array(); } }-*/;
	/** getDocumentEntryCategories: <p>Retrieves all categories contained in entry.</p> */
	public final native DocumentsListEntryCategory[] getDocumentEntryCategories() /*-{ if (this.category) { return @com.google.gwt.gdata.client.impl.ArrayHelper::toArray(Lcom/google/gwt/core/client/JsArray;)(this.category); } else { return new Array(); } }-*/;

	/** getContentType: <p>Retrieves the (mime) type of the content.</p> */
	public final native String getContentType() /*-{ if (this.content) { return this.content.type; } else { return ""; } }-*/;
	/** getContentSrc: <p>Retrieves the content (usually as link).</p> */
	public final native String getContentSrc() /*-{ if (this.content) { return this.content.src; } else { return ""; } }-*/;
	/** getResourceId: <p>Retrieves plain ID (type:docId).</p> */
	public final native String getResourceId() /*-{ if (this.gd$resourceId) { return this.gd$resourceId.$t; } else { return ""; } }-*/;
	/** getLastModifiedByName: <p>Retrieves the name of the latest editing user.</p> */
	public final native String getLastModifiedByName() /*-{ if (this.gd$lastModifiedBy) { return this["gd$lastModifiedBy"][0]["name"]["$t"]; } else { return "default"; } }-*/;
	/** getLastModifiedByEmail: <p>Retrieves the email address of the latest editing user.</p> */
	public final native String getLastModifiedByEmail() /*-{ if (this.gd$lastModifiedBy) { return this["gd$lastModifiedBy"][0]["email"]["$t"]; } else { return "default"; } }-*/;
	/** getLastModifiedByUri: <p>Retrieves the photo uri of the latest editing user.</p> */
	public final native String getLastModifiedByUri() /*-{ if (this.gd$lastModifiedBy) { return this["gd$lastModifiedBy"][0]["uri"]["$t"]; } else { return "default"; } }-*/;
	/** getLastViewed: <p>Retrieves date of latest viewing.</p> */
	public final native String getLastViewed() /*-{ if (this.gd$lastViewed) { return this.gd$lastViewed.$t; } else { return ""; } }-*/;
	/** getQuotaBytesUsed: <p>Retrieves used up quota by this resource (only available for unconverted files).</p> */
	public final native String getQuotaBytesUsed() /*-{ if (this.gd$quotaBytesUsed) { return this.gd$quotaBytesUsed.$t; } else { return ""; } }-*/;
	/** getWritersCanInvite: <p>Indicates, if collaborators can share this document to other users. Returns 'true' or 'false'.</p> */
	public final native String getWritersCanInvite() /*-{ if (this.docs$writersCanInvite) { return this.docs$writersCanInvite.value; } else { return ""; } }-*/;
	/** getAclLink: <p>Retrieves a link to the access control list.</p> */
	public final native String getAclLink() /*-{ if (this.gd$feedLink) { for (var link in this.gd$feedLink) { if (link.rel == "http://schemas.google.com/acl/2007#accessControlList") return link.href; return ""; } } else { return ""; } }-*/;
	/** getRevisionsLink: <p>Retrieves a link to the list of revisions.</p> */
	public final native String getRevisionsLink() /*-{ if (gd$this.feedLink) { for (var link in this.gd$feedLink) { if (link.rel == "http://schemas.google.com/docs/2007/revisions") return link.href; return ""; } } else { return ""; } }-*/;
	/** getRemoved: <p>Retrieves removal indicator.</p> */
	public final native String getRemoved() /*-{ if (this.docs$removed) { return this.docs$removed.$t; } else { return ""; } }-*/;
	/** getChangestamp: <p>Retrieves changestamp.</p> */
	public final native String getChangestamp() /*-{ if (this.docs$changestamp) { return this.docs$changestamp.$t; } else { return ""; } }-*/;

	// constructors
	/**
	 * newInstance: <p>Creates new ChangesEntry instance.</p>
	 * @return DocumentsListChangesEntry
	 */
	public static native DocumentsListChangesEntry newInstance() /*-{ return new $wnd.google.gdata.Entry(); }-*/;
	protected DocumentsListChangesEntry() { }
	public static final native JavaScriptObject getConstructor() /*-{ return $wnd.google.gdata.Entry; }-*/;

}